package com.qidian.mes.device.controller;

import com.qidian.common.pojo.MESResult;
import com.qidian.mes.device.service.TypeService;
import com.qidian.mes.pojo.Type;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author 刘泽磊
 * @Company 起点编程
 * @Description
 * @Time 2024/10/23 15:35
 */
@RestController
@RequestMapping("/type")
@CrossOrigin
public class TypeController {
    @Autowired
    private TypeService typeService;
    @GetMapping("/list")
    public MESResult select(Type type){
        return typeService.select(type);
    }
    @PostMapping("/insert")
    public MESResult insert(@RequestBody Type type){
        return typeService.insert(type);
    }
    @PutMapping("/update")
    public MESResult update(@RequestBody Type type){
        return typeService.update(type);
    }
    @GetMapping("/selectById")
    public MESResult selectById(Long typeId){
        return typeService.selectById(typeId);
    }
    @DeleteMapping("/delete")
    public MESResult delete(Long typeId){
        return typeService.delete(typeId);
    }
}
